Skip to content

chore(settings): remove deprecated freshAgent.fontScale setting#512

Merged
danshapiro merged 1 commit into
mainfrom
chore/remove-freshagent-fontscale
Jul 8, 2026
Merged

chore(settings): remove deprecated freshAgent.fontScale setting#512
danshapiro merged 1 commit into
mainfrom
chore/remove-freshagent-fontscale

Conversation

@danshapiro

Copy link
Copy Markdown
Owner

What

Remove the inert freshAgent.fontScale setting entirely from shared/settings.ts (constants, local-key registration, type field, normalizers, default, sanitize branch). Legacy localStorage records/seeds containing fontScale are passively dropped by the existing allow-list sanitizers; regression tests pin clean rehydration. The agentChat legacy migration is kept (no fontScale-specific code). Spec doc included at docs/plans/2026-07-08-remove-freshagent-fontscale-spec.md.

Why

Dead weight — no UI control, no runtime consumer (fresh-agent transcripts follow terminal.fontSize), already excluded from persistence writes; confirmed zero production references outside shared/settings.ts.

Verification

  • TDD
  • npm run check full coordinated suite green (8,692 tests)
  • Lint 0 errors
  • Post-removal grep for fontScale in production code returns zero

Generated with Amplifier

freshAgent.fontScale has been inert for some time: no UI control, no
runtime consumer (fresh-agent transcripts follow terminal.fontSize via
--fresh-transcript-font-size), and deliberately excluded from
persistence writes. Remove it entirely from shared/settings.ts:
constants, local-key registration, type field, normalizers, default,
and sanitize branch.

Legacy inputs (old localStorage records, settings seeds) containing
fontScale are now passively dropped by the existing allow-list
sanitizers; regression tests pin that old records rehydrate cleanly
with fontScale absent. The agentChat legacy migration path is kept --
it migrates the surviving fresh-agent keys and has no fontScale-
specific code.

Verified with npm run check (full coordinated suite green); zero
fontScale references remain in production code.

Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@danshapiro
danshapiro merged commit 92b3246 into main Jul 8, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f6bedc8f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shared/settings.ts
Comment on lines 87 to 90
'showThinking',
'showTools',
'showTimecodes',
'fontScale',
] as const

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Drop fontScale when stripping freshAgent-only patches

With fontScale removed from this local-key list, stripLocalSettings({ freshAgent: { fontScale: 1.25 } }, { migrateLegacyFreshAgentAlias: false }) no longer enters the migratedFreshAgent branch because the sanitizer returns undefined, so the shallow-copied freshAgent object remains in next. That lets stale/deprecated patches sent through normalizeServerSettingsPatchForApi reach /api/settings as freshAgent.fontScale, which the strict server schema rejects instead of silently dropping as intended; delete/overwrite next.freshAgent whenever a raw freshAgent block exists but sanitizes to empty.

Useful? React with 👍 / 👎.

danshapiro pushed a commit that referenced this pull request Jul 18, 2026
…umb, re-anchor

Cherry-pick of main 5c56ecc (#516), recorded src/ deviation.

The port's src/ is frozen at an older main snapshot, but this client-side
restore fix (bounded codex .lost resume, durable_artifact_missing
breadcrumb for codex terminals, and re-anchoring unattached panes on
reconnect) needed to ship on the port branch ahead of full reconciliation.

Three defects fixed (client-only, no server/shared changes):
1. FreshAgentView.tsx: the .lost-state recovery/retry reaction was
   claude-only even though markSessionLost fires for any provider on
   INVALID_SESSION_ID. A codex pane that went "lost" sat permanently
   abandoned. Extended to codex via the existing agentSession selector
   plus a new getCanonicalCodexResumeSessionId helper (codex threads
   don't have Claude's UUID-format validator). Opencode is unaffected --
   it already has its own dedicated lost-thread recovery path.
2. TerminalView.tsx: on INVALID_TERMINAL_ID with no sessionRef/
   codexDurability candidate, the client collapsed to a brand-new
   terminal and silently cleared restoreError, destroying any trace of
   the pane's prior durable identity. Added a tab-level sessionRef
   fallback so a pane can recover before collapsing to fresh, and codex
   panes now persist a durable_artifact_missing breadcrumb instead of a
   silent clean slate when genuinely no identity exists. Scoped to codex
   only -- claude/gemini keep their existing silent-clean-fresh contract.
3. TerminalView.tsx onReconnect: re-drives creation (same createRequestId,
   idempotent) for any pane still unanchored on every reconnect
   completion, fixing a one-shot restore when a second disconnect landed
   before terminal.created arrived.

Adaptations required: none. `git cherry-pick -n 5c56ecc` applied cleanly
with zero conflicts -- the port's frozen FreshAgentView.tsx/TerminalView.tsx
still had identical context around every touched hunk, since main commits
#512 (fontscale removal) and #513 (editor-font) that landed in the 49-commit
gap do not touch either file. Verified by diffing the applied changes
against main's diff: byte-identical.

Verification on the port branch:
- npx vitest run (2 cherry-picked test files): 111/111 passed
  (TerminalView.codex-identity.test.tsx 6 tests, FreshAgentView.test.tsx
  105 tests)
- TerminalView.lifecycle.test.tsx (claude/gemini silent-fresh contract):
  128/128 passed
- npx tsc --noEmit: clean
- npm run build:client: succeeded, dist/client rebuilt
- npx playwright test restore-matrix.spec.ts restore-sync05.spec.ts
  --project=rust-chromium --project=legacy-chromium: 14/14 passed

git diff 737cb00 --name-only -- src/ now lists exactly 3 files:
  src/components/icons/provider-icons.tsx (pre-existing deviation)
  src/components/fresh-agent/FreshAgentView.tsx
  src/components/TerminalView.tsx

Recorded in docs/plans/2026-07-17-rust-transition-campaign-status.md
(frozen-paths deviation record).

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant